$OpenBSD: patch-u_error_c,v 1.2 2017/02/01 10:09:58 kirby Exp $

Avoids null deref->segfault->core seen if you exit by closing the window.

--- src/u_error.c.orig	Thu May  5 00:05:10 2016
+++ src/u_error.c	Thu Dec 22 12:22:20 2016
@@ -65,6 +65,9 @@ int X_error_handler(Display *d, XErrorEvent *err_ev)
     /* uninstall error handlers so we don't recurse if another error happens! */
     XSetErrorHandler(NULL);
     XSetIOErrorHandler((XIOErrorHandler) NULL);
+    if (!err_ev) {
+    	return 0;
+    }
     XGetErrorText(tool_d, (int) (err_ev->error_code), err_msg, MAXERRMSGLEN - 1);
     (void) fprintf(stderr,
 	   "xfig%s: X error trapped - error message follows:\n%s\n",
